#include <unistd.h>
#include <seccomp.h>
#include <sys/syscall.h>
#include <iostream>
const char* command[] = {"./test.out", NULL};

int main() {
    scmp_filter_ctx ctx;
    ctx = seccomp_init(SCMP_ACT_KILL);
    seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SYS_execve, 1, SCMP_CMP(0, SCMP_CMP_EQ, (scmp_datum_t)command[0]));
    seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SYS_openat, 1, SCMP_CMP(2, SCMP_CMP_MASKED_EQ, 7, 0));
    seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SYS_open, 1, SCMP_CMP(1, SCMP_CMP_MASKED_EQ, 7, 0));
    seccomp_load(ctx);
    execv(command[0], (char**)command);
    return 0;
}
